This invention relates to interface circuitry. More specifically, it relates to interface circuitry to determine the state of a plurality of switches.
In many electronic applications, it is desired to interface a large number of switches to devices which have a limited number of input/output ports, for example, a microcontroller. These switches are generally used to indicate the status of a circuit or a system, although the present invention is not limited to such uses. The switches, for example, can be manual switches which are initially set in an open or closed position by a user of a system to indicate a preferred system status. The individual switch settings can be read by a microcontroller which implements the proper initial operating conditions in accordance with the selected positions. As another example, the switches could be latches which are dynamically set to indicate system status.
Conventionally, one switch is interfaced to a microcontroller by using a single input pin and a pull-up resistor, as illustrated in FIG. 1. The conventional switch interface, therefore, limits the number of switches that can be interfaced to a microcontroller.
A problem frequently encountered in the design of microcontroller based circuitry, however, is the limited input/output available in the microcontroller. This is especially true where the full power of the microcontroller is to be utilized. A typical microcontroller, for example, a Motorola 6805, has four eight-bit ports. Some of the input/output pins in these ports, however, can be utilized only for special purpose interfaces, such as serial input/output or timer inputs. In such cases, the number of general purpose ports is limited. Similar problems exist where microcontrollers use their ports to interface to external program memory or where a circuit board having a connector with limited input/output is being interfaced to as well as in many other electronic designs.
A switch interface circuit which allows a decision making component to determine the positions of each individual switch and which minimizes the usage of input/output ports, therefore, is needed.